/*----------------------------------------------------------------------------------------------
* This source file is part of Kinect-Fighter (A Fighting Game controlled 
*	by Kinect and Keyboard.)
*
* Copyright (c) 2012-2012 Hu Guozhu
*
* Usage of this program is free for non-commercial use and licensed under the
* the terms of the MIT License.
*
*-------------------------------------------------------------------------------------------------*/

#include "stdafx.h"
#include "KFPrerequisites.h"

#include "kferror.h"
#include "KFKinectManager.h"
#include "KFClientApp.h"
#include "KFRenderManager.h"
#include "KFInputManager.h"

using namespace KinectFighter;

int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{	
	KFClientApp		*pApp = KFClientApp::GetSingletonPtr();
	// main loop
	try
	{
		pApp->mInstance = hInstance;
		pApp->Init();
		pApp->Run();
		pApp->Clean();		
	}
	catch ( Ogre::Exception& ex )
	{
		MessageBox(NULL,ex.getFullDescription().c_str(),"An exception has occurred!",MB_OK|MB_ICONERROR|MB_TASKMODAL);
	}
	catch(char* msg)
	{
		MessageBox(NULL,msg,"ErrorInfo",MB_OK);
	}
	return 0;
}
